// 自定义启动服务器
const express = require('express');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpack = require('webpack');
const webpackConfigs = require('./webpack.config.js');
const complier = webpack(webpackConfigs);

const app = express();
app.use(webpackDevMiddleware(complier, {
	publicPath: webpackConfigs.output.publicPath
}))

app.listen(3000, '127.0.0.1', () => {
	console.log('server is running 127.0.0.1')
})